package com.charon.common.persistence;

import java.util.LinkedHashMap;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

/**
 * @Description: BaseDao
 * @author charon [248135724@qq.com]
 * @date: 2018年9月1日 下午8:13:10   
 */
public interface BaseDao<T> {
	
	@Select("MapperGD.findAll")
	public List<T> findAll();
	
	@Select("MapperGD.findBySql")
	public List<T> findBySQL();
	
	@Select("MapperGD.selectBySQL")
	public LinkedHashMap<?, ?> selectBySQL();
	
	@Delete("MapperGD.deleteBySQL")
	public Integer deleteBySQL();
	
	@Update("MapperGD.updateBySQL")
	public Integer updateBySQL();
	
	@Insert("MapperGD.insertBySQL")
	public Integer insertBySQL();
	
	@Select("MapperGD.selectByID")
	public List<T> selectByID(int id);
	
	@Insert("MapperGD.insertByEntity")
	public void insertByEntity(T t);
	
	@Delete("MapperGD.deleteByID")
	public void deleteById(int id);
	
	@Insert("MapperGD.insertByEntity")
	public void updateByEntity(T t);
}
